<include file="public/min-header"/>
<div class="wrapper">
  <include file="public/breadcrumb"/>
  <style>#search-form > .form-group{margin-left: 10px;}</style>
  <!-- Main content -->
  <section class="content">
    <div class="container-fluid">
      <div class="panel panel-default">
        <div class="panel-heading">
          <h3 class="panel-title"><i class="fa fa-list"></i> 套餐列表</h3>
        </div>
        <div class="panel-body">
          <div class="navbar navbar-default">

            <form action="javascript:;" id="search-form" class="navbar-form form-inline" method="post" onsubmit="return false">
              <div class="form-group">
                <input type="text" name="keywords" class="form-control" placeholder="搜索：套餐名称">
              </div>

              <button type="submit" onclick="ajax_get_table('search-form', 1)" id="button-filter search-order" class="btn btn-primary"><i class="fa fa-search"></i> 筛选</button>
              <button type="button" onclick="layerAlert('添加套餐', '{:U('package/add')}', '70%', '85%')" class="btn btn-primary pull-right"><i class="fa fa-plus"></i>添加套餐</button>
            </form>
          </div>
          <div id="ajax_return"> </div>
        </div>
      </div>
    </div>
    <!-- /.row -->
  </section>
  <!-- /.content -->
</div>
<!-- /.content-wrapper -->
<script>
  $(document).ready(function(){
    // ajax 加载商品列表
    ajax_get_table('search-form', 1);

  });
  cur_page = 1;
  // ajax 抓取页面 form 为表单id  page 为当前第几页
  function ajax_get_table(form, page){
    cur_page = page; //当前页面 保存为全局变量
    $.ajax({
      type : "POST",
      url:"/index.php?m=mingteng&c=package&a=ajax_index&page="+page,//+tab,
      data : $('#'+form).serialize(),// 你的formid
      success: function(data){
        $("#ajax_return").html('');
        $("#ajax_return").append(data);
      }
    });
  }

</script>
</body>
</html>